<!--跟投项目管理 新增编辑-->
<template>
    <div class="operateFollowPro">
        <el-breadcrumb separator="/" class="bread-title">
            <el-breadcrumb-item :to="{ path: '/projectList' }">跟投项目管理</el-breadcrumb-item>
            <el-breadcrumb-item v-if="pageType==='add'">新增</el-breadcrumb-item>
            <el-breadcrumb-item v-if="pageType==='edit'">编辑</el-breadcrumb-item>
        </el-breadcrumb>

        <el-steps :active="active" style="width: 80%;">
            <el-step title="项目跟投信息"></el-step>
            <el-step title="跟投标准及规则绑定"></el-step>
            <el-step title="募集份额设置"></el-step>
            <el-step title="定向跟投人员设置"></el-step>
            <el-step title="预览"></el-step>
        </el-steps>

        <div v-show="active==1">
            <el-form :model="ruleForm1" :rules="rules1" ref="ruleForm1" label-width="180px" class="demo-ruleForm">
                <h3>项目信息</h3>
                <div class="flex-content">
                    <el-form-item label="项目名称：" prop="projectId">
                        <el-select filterable v-model="ruleForm1.projectId" placeholder="请选择项目" @change="projectChange">
                            <el-option v-for="(item,index) in projectList" :label="item.projectName" :value="item.estateProjectId" :key="index"></el-option>
                        </el-select>
                    </el-form-item>
                    <el-form-item label="所属公司：">
                        <el-input v-model="projectCheck.companyName" class="w-300" disabled></el-input>
                    </el-form-item>
                </div>
                <div class="flex-content">
                    <el-form-item label="所属城市：">
                        <el-input v-model="projectCheck.city" class="w-200" disabled></el-input>
                    </el-form-item>
                    <div></div>
                </div>


                <h3>打款账户信息</h3>
                <div class="flex-content">
                    <el-form-item label="公司：" prop="companyName">
                        <el-input v-model="ruleForm1.companyName" :title="ruleForm1.companyName" disabled class="w-200"></el-input>
                        <el-button type="primary" style="margin-left:-3.5px;" @click="choseCompanyHandle()">选择
                        </el-button>
                    </el-form-item>

                    <el-form-item label="开户名称：" prop="openingBank">
                        <el-input v-model="ruleForm1.openingBank" :title="ruleForm1.openingBank" class="w-200" disabled></el-input>
                        <el-button type="primary" style="margin-left:-3.5px;" @click="choseOpenBankHandle()">选择
                        </el-button>
                    </el-form-item>
                </div>
                <div class="flex-content">
                    <el-form-item label="开户行名称：" prop="bankName">
                        <el-input v-model="ruleForm1.bankName" :title="ruleForm1.bankName" class="w-200" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="银行账号：" prop="bankAccount">
                        <el-input v-model="ruleForm1.bankAccount" disabled></el-input>
                    </el-form-item>
                </div>
                <div class="flex-content">
                    <el-form-item label="联行号：" prop="bankNumber">
                        <el-input v-model="ruleForm1.bankNumber" class="w-200" disabled></el-input>
                    </el-form-item>
                    <el-form-item label="地区代码信息：" prop="bankAreaCode">
                        <el-input v-model="ruleForm1.bankAreaCode" disabled></el-input>
                    </el-form-item>
                </div>
                <div class="flex-content">
                    <el-form-item label="开户行所在省市：">
                        <el-input v-model="ruleForm1.openingBankProvince" class="w-80" disabled></el-input>
                        <el-input v-model="ruleForm1.openingBankCity" class="w-80" disabled></el-input>
                    </el-form-item>
                    <div></div>
                </div>


                <h3>跟投信息</h3>
                <div class="flex-content">
                    <el-form-item label="申购开始日期：" prop="date1">
                        <el-date-picker
                                v-model="ruleForm1.date1"
                                @change="changeTimeValidate12"
                                type="date"
                                placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>

                    <el-form-item label="申购结束日期：" prop="date2">
                        <el-date-picker
                                v-model="ruleForm1.date2"
                                @change="changeTimeValidate24"
                                type="date"
                                placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
                </div>
                <div class="flex-content">
                    <el-form-item label="跟投开始日期：" prop="date3">
                        <el-date-picker
                                @change="changeTimeValidate34"
                                v-model="ruleForm1.date3"
                                type="date"
                                placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
                    <el-form-item label="跟投结束日期：" prop="date4">
                        <el-date-picker
                                v-model="ruleForm1.date4"
                                type="date"
                                placeholder="选择日期">
                        </el-date-picker>
                    </el-form-item>
                </div>
                <div class="flex-content">
                    <el-form-item label="预计项目周期（月）：" prop="estimateCycle">
                        <el-input v-model="ruleForm1.estimateCycle" type="number" class="w-200"></el-input>
                    </el-form-item>
                    <el-form-item label="收益方式：" prop="gainsType">
                        <el-select v-model="ruleForm1.gainsType">
                            <el-option label="项目清算后返还" value="0"></el-option>
                        </el-select>
                    </el-form-item>
                </div>

                <!--三个文本框-->
                <el-form-item label="跟投方案：" prop="investPlan">
                    <el-input type="textarea" :autosize="{ minRows: 3}" :maxlength="1000" v-model="ruleForm1.investPlan" class="w-800"></el-input>
                </el-form-item>
                <el-form-item label="收益说明：" prop="gainsExplain">
                    <el-input type="textarea" :autosize="{ minRows: 3}" :maxlength="1000" v-model="ruleForm1.gainsExplain" class="w-800"></el-input>
                </el-form-item>
                <el-form-item label="申购规则：" prop="applyRule">
                    <el-input type="textarea" :autosize="{ minRows: 3}" :maxlength="1000" v-model="ruleForm1.applyRule" class="w-800"></el-input>
                </el-form-item>
            </el-form>
            <div class="mt50" style="text-align: center;">
                <el-button class="mr50" type="primary" @click="submitForm('ruleForm1')">下一步</el-button>
                <el-button type="primary" @click="$router.back()">取消</el-button>
            </div>
        </div>
        <!--选择内部法人单位-->
        <el-dialog title="选择内部法人单位" :visible.sync="choseCompanyVisible" width="70%">
            公司名称：
            <el-input v-model="choseCompanyParams.companyName" placeholder="请输入公司名称" style="width:217px;"></el-input>
            <el-button type="primary" @click="searchLoadCompany">查询</el-button>
            <el-table :data="choseCompanyData" border stripe style="margin:20px 0;" @row-click="getCompanyItem">
                <el-table-column label="序号" type="index" align="center" width="55"></el-table-column>
                <el-table-column label="" align="center" width="55">
                    <template slot-scope="scope">
                        <el-radio class="radio" v-model="choseCompanyRadio" :label="scope.$index">&nbsp;</el-radio>
                    </template>
                </el-table-column>
                <el-table-column label="公司名称" prop="companyName" align="center"></el-table-column>
                <el-table-column label="法定代表人" prop="companyRepresentative" align="center"></el-table-column>
                <el-table-column label="纳税人识别号" prop="companyTaxpayer" align="center"></el-table-column>
                <el-table-column label="公司地址" prop="companyAddress" align="center">
                    <template slot-scope="scope">
                        {{scope.row.companyProvince}}{{scope.row.companyCity}}{{scope.row.companyCounty}}{{scope.row.companyAddress}}
                    </template>
                </el-table-column>
                <el-table-column label="邮政编码" prop="companyPostalcode" align="center"></el-table-column>
                <el-table-column label="联系电话" prop="companyPhone" align="center"></el-table-column>
            </el-table>
            <el-pagination
                    @size-change="handleSizeChange4"
                    @current-change="handleCurrentChange4"
                    :current-page="choseCompanyParams.pageNum"
                    :page-sizes="[10, 20, 40, 50]"
                    :page-size="choseCompanyParams.pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="contractCompanyTotal" style="margin-top:30px;">
            </el-pagination>
            <div class="btns" style="margin-top:15px;">
                <el-button type="primary" @click="closeChosecompany">关闭</el-button>
                <el-button type="primary" @click="assignmentCompany">确定</el-button>
            </div>
        </el-dialog>

        <!-- 选择开户行-->
        <el-dialog title="选择开户行信息" :visible.sync="choseOpenbankVisible" width="70%">
            <el-table :data="choseOpenbankData" border stripe style="margin:20px 0;" @row-click="getBankItem">
                <el-table-column label="序号" type="index" align="center" width="55"></el-table-column>
                <el-table-column label="" align="center" width="55">
                    <template slot-scope="scope">
                        <el-radio class="radio" v-model="choseOpenbankRadio" :label="scope.$index">&nbsp;</el-radio>
                    </template>
                </el-table-column>
                <el-table-column label="开户银行" prop="openingBank" align="center"></el-table-column>
                <el-table-column label="开户名称" prop="bankName" align="center"></el-table-column>
                <el-table-column label="开户账户" prop="bankAccount" align="center"></el-table-column>
                <el-table-column label="联行号" prop="bankNumber" align="center"></el-table-column>
                <el-table-column label="地区代码信息" prop="bankAreaCode" align="center"></el-table-column>
                <el-table-column label="开户行所属省" prop="openingBankProvince" align="center"></el-table-column>
                <el-table-column label="开户行所属市" prop="openingBankCity" align="center"></el-table-column>
            </el-table>
            <div class="btns">
                <el-button type="primary" @click="closeChoseOpenbank">关闭</el-button>
                <el-button type="primary" @click="assignmentBank">确定</el-button>
            </div>
        </el-dialog>

        <!--第二步-->
        <div v-show="active==2">
            <secondStep ref="secondStep" :renderData2="renderData2" :businessModeCode="projectCheck.businessModeCode"></secondStep>
            <div class="mt50" style="text-align: center">
                <el-button class="mr50" type="primary" @click="second1">上一步</el-button>
                <el-button class="mr50" type="primary" @click="second2('ruleForm1')">下一步</el-button>
                <el-button type="primary" @click="$router.back()">取消</el-button>
            </div>
        </div>

        <!--第三步-->
        <div v-show="active==3">
            <thirdStep ref="thirdStep" :renderData3="renderData3" :thirdUse="thirdUse"></thirdStep>
            <div class="mt50" style="text-align: center">
                <el-button class="mr50" type="primary" @click="third1">上一步</el-button>
                <el-button class="mr50" type="primary" @click="third2('ruleForm1')">下一步</el-button>
                <el-button type="primary" @click="$router.back()">取消</el-button>
            </div>
        </div>


        <!--第四步-->
        <div v-show="active==4">
            <fourthStep ref="fourthStep" :renderData4="renderData4" :fourthUse="fourthUse"></fourthStep>
            <div class="mt50" style="text-align: center">
                <el-button class="mr50" type="primary" @click="fourth1">上一步</el-button>
                <el-button class="mr50" type="primary" @click="fourth2('ruleForm1')">下一步</el-button>
                <el-button type="primary" @click="$router.back()">取消</el-button>
            </div>
        </div>


        <!--第五步-->
        <div v-show="active==5">
            <viewDetail ref="viewDetail" style="padding:30px 0" :totalData="totalData"></viewDetail>
            <div class="mt50" style="text-align: center">
                <el-button class="mr50" type="primary" @click="fifth1">上一步</el-button>
                <el-button class="mr50" type="primary" @click="fifth2('ruleForm1')">保存</el-button>
                <el-button type="primary" @click="$router.back()">取消</el-button>
            </div>
        </div>
    </div>
</template>

<script>
    import api from '@/api/apiPath'
    import utils from '@/common/utils.js'


    import secondStep from './operateFollowProCom/secondStep'
    import thirdStep from './operateFollowProCom/thirdStep'
    import fourthStep from './operateFollowProCom/fourthStep'
    import viewDetail from './operateFollowProCom/viewDetail'

    export default {
        name: "operateFollowPro",
        components: {secondStep, thirdStep, fourthStep, viewDetail},
        data() {
            var validateDate2 = (rule, value, callback) => {
                if (value <= this.ruleForm1.date1) {
                    callback(new Error('申购结束时间须大于申购开始时间'))
                } else {
                    callback()
                }
            };
            var validateDate4 = (rule, value, callback) => {
                if (value <= this.ruleForm1.date3) {
                    callback(new Error('跟投结束时间须大于跟投开始时间'))
                } else if (value < this.ruleForm1.date2) {
                    callback(new Error('跟投结束时间须大于申购结束日期'))
                } else {
                    callback()
                }
            };
            var validateEstimateCycle = (rule, value, callback) => {
                let reg = /^[1-9]\d*$/g;
                if (reg.test(value)) {
                    callback()
                } else {
                    callback(new Error('请输入正整数'))
                }
            };

            return {
                active: 1,
                /**
                 * 第一步
                 */
                projectList: [],
                projectCheck: {},
                ruleForm1: {
                    projectId: '',
                    companyName: '',
                    openingBank: '',
                    date1: '',
                    date2: '',
                    date3: '',
                    date4: '',
                    estimateCycle: '', // 预计项目周期
                    gainsType: '', // 项目清算方式
                    investPlan: '', // 跟投方案
                    gainsExplain: '', // 收益说明
                    applyRule: '', // 申购规则
                },
                rules1: {
                    projectId: [
                        {required: true, message: '请选择项目', trigger: 'change'}
                    ],
                    companyName: [
                        {required: true, message: '请选择公司', trigger: 'change'}
                    ],
                    openingBank: [
                        {required: true, message: '请选择开户行', trigger: 'change'}
                    ],
                    date1: [
                        {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
                    ],
                    date2: [
                        {type: 'date', required: true, message: '请选择日期', trigger: 'change'},
                        {validator: validateDate2, trigger: 'change'}
                    ],
                    date3: [
                        {type: 'date', required: true, message: '请选择日期', trigger: 'change'}
                    ],
                    date4: [
                        {type: 'date', required: true, message: '请选择日期', trigger: 'change'},
                        {validator: validateDate4, trigger: 'change'}
                    ],
                    estimateCycle: [
                        {required: true, message: '请填写预计项目周期（月）', trigger: 'blur'},
                        {validator: validateEstimateCycle, trigger: 'change'}
                    ],
                    gainsType: [
                        {required: true, message: '请选择收益方式', trigger: 'change'},
                    ],
                    investPlan: [
                        {required: true, message: '请填写跟投方案', trigger: 'change'},
                    ],
                    gainsExplain: [
                        {required: true, message: '请填写收益说明', trigger: 'change'},
                    ],
                    applyRule: [
                        {required: true, message: '请填写申购规则', trigger: 'change'},
                    ]
                },
                choseCompanyVisible: false, // 第一步选择公司弹窗
                choseCompanyParams: {//内部法人的参数
                    pageNum: 1,
                    pageSize: 10,
                    companyName: ""
                },
                choseCompanyData: [],
                contractCompanyTotal: 0,
                choseCompanyRadio: "",//选择内部法人的单选
                choseCompanySelected: {},//选择内部法人单选的数据
                choseOpenbankVisible: false, // 选择开户行弹窗

                choseOpenbankData: [],//选择开开户行的数据
                choseOpenbankRadio: "",//选择开户行的单选
                choseOpenbankSelected: {},//选择开户行单选的数据
                /**
                 * 第二步
                 */

                /**
                 * 第三步
                 */
                thirdUse: [],
                /**
                 * 第四步
                 */
                fourthUse: 0,
                /*
                * 第五步
                * */
                totalData: {},

                investId: '',
                renderData2: {},
                renderData3: {},
                renderData4: [],
            }
        },
        methods: {
            changeTimeValidate12() {
                if(this.ruleForm1.date2){
                    this.$refs.ruleForm1.validateField('date2')
                }
            },
            changeTimeValidate34() {
                if(this.ruleForm1.date4){
                    this.$refs.ruleForm1.validateField('date4')
                }
            },
            changeTimeValidate24() {
                if(this.ruleForm1.date4){
                    this.$refs.ruleForm1.validateField('date4')
                }
            },
            /**
             * 第一步
             */
            // 查询项目列表
            getAllPassProject() {
                this.axios.get(api.getAllPassProject).then(res => {
                    this.projectList = res.data.data.data
                })
            },
            projectChange() {
                let project = this.projectList.find(item => {
                    return item.estateProjectId === this.ruleForm1.projectId
                });
                this.projectCheck = project
            },
            //选择公司弹框
            choseCompanyHandle() {
                this.choseCompanyVisible = true;
                this.loadCompany()
            },
            //关闭内部法人的弹框
            closeChosecompany() {
                this.choseCompanyVisible = false;
            },

            //选择内部法人赋值
            getCompanyItem(row) {
                this.choseCompanyRadio = this.choseCompanyData.indexOf(row);
                this.choseCompanySelected = row;
            },
            //内部法人点击确定赋值给要传递的参数
            assignmentCompany() {
                console.log('选择的公司为:', this.choseCompanySelected)
                this.choseCompanyVisible = false
                this.ruleForm1.companyName = this.choseCompanySelected.companyName;
                this.ruleForm1.openingBank = '';
                this.ruleForm1.bankName = '';
                this.ruleForm1.bankAccount = '';
                this.ruleForm1.bankNumber = '';
                this.ruleForm1.bankAreaCode = '';
                this.ruleForm1.openingBankProvince = '';
                this.ruleForm1.openingBankCity = '';
            },

            searchLoadCompany() {
                this.choseCompanyParams.pageNum = 1;
                this.loadCompany()
            },
            loadCompany() {
                this.axios.post(api.INITCOMPANY, this.choseCompanyParams).then((res) => {
                    let result = res.data.data.list
                    this.choseCompanyData = result;
                    this.contractCompanyTotal = res.data.data.total;
                }).catch((error) => {
                    console.log(error)
                })
            },
            //选择开户行
            choseOpenBankHandle() {
                this.choseOpenbankVisible = true;
                this.loadBank()
            },
            loadBank() {
                this.axios.post(api.INITBANKLIST, {
                    contractUndersignType: 0,
                    insideId: this.choseCompanySelected.id
                }).then((res) => {
                    if (res.data.code === 200) {
                        this.choseOpenbankData = res.data.data;
                    }
                }).catch((error) => {
                    console.log(error)
                })
            },
            // 关闭选择开户行弹窗
            closeChoseOpenbank() {//关闭开户行的弹框
                this.choseOpenbankVisible = false
            },
            // 点击开户行的行
            getBankItem(row) {//开户行赋值
                this.choseOpenbankRadio = this.choseOpenbankData.indexOf(row);
                this.choseOpenbankSelected = row;
            },
            //开户行点击确定赋值给要传递的参数
            assignmentBank() {
                console.log('选择的银行是：', this.choseOpenbankSelected);
                this.choseOpenbankVisible = false;

                // 选银行后置空其他消息
                this.ruleForm1.openingBank = this.choseOpenbankSelected.openingBank;
                this.ruleForm1.bankName = this.choseOpenbankSelected.bankName;
                this.ruleForm1.bankAccount = this.choseOpenbankSelected.bankAccount;
                this.ruleForm1.bankNumber = this.choseOpenbankSelected.bankNumber;
                this.ruleForm1.bankAreaCode = this.choseOpenbankSelected.bankAreaCode;
                this.ruleForm1.openingBankProvince = this.choseOpenbankSelected.openingBankProvince;
                this.ruleForm1.openingBankCity = this.choseOpenbankSelected.openingBankCity;
                this.choseOpenbankRadio = "";
            },

            handleSizeChange4(val) {//选择内部法人分页
                this.choseCompanyParams.pageSize = val;
                this.loadCompany();
            },
            handleCurrentChange4(val) {//选择内部法人分页
                this.choseCompanyRadio = "";
                this.choseCompanyParams.pageNum = val;
                this.loadCompany();
            },


            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        this.active = 2
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            resetForm(formName) {
                this.$refs[formName].resetFields();
            },

            /**
             * 第二步
             */
            second1() {
                this.active = 1
            },
            second2() {
                this.$refs.secondStep.isCanGoNextStep().then((res) => {
                    if (res) {
                        let otherPageUse = this.$refs.secondStep.otherPageUse;
                        this.fourthUse = otherPageUse.fourthRuleId;
                        if (otherPageUse.thirdScale) {
                            this.thirdUse = {
                                money: otherPageUse.thirdMoney,
                                scale: otherPageUse.thirdScale,
                            };
                            this.active = 3
                        } else {
                            this.active = 4
                        }
                    }
                })
            },
            /**
             * 第三步
             */
            third1() {
                this.active = 2
            },
            third2() {
                this.$refs.thirdStep.isCanGoNextStep().then((res) => {
                    if (res) {
                        let otherPageUse = this.$refs.secondStep.otherPageUse;
                        if (otherPageUse.fourthJudgeJump) {
                            this.active = 4;
                        } else {
                            this.concatData();
                            this.active = 5;
                        }

                    }
                })
            },
            /**
             * 第四步
             */
            fourth1() {
                let otherPageUse = this.$refs.secondStep.otherPageUse;
                if (otherPageUse.thirdScale) {
                    this.active = 3
                } else {
                    this.active = 2
                }
            },
            fourth2() {
                if (this.$refs.fourthStep.isCanGoNextStep()) {
                    this.concatData();
                    this.active = 5
                }

            },
            /**
             * 第五步
             */
            fifth1() {
                let otherPageUse = this.$refs.secondStep.otherPageUse;
                if (otherPageUse.fourthJudgeJump) {
                    this.active = 4;
                } else {
                    this.active = 3;
                }
            },
            fifth2() {
                let sendParams = this.$refs.viewDetail.sendParams;
                let url = api.saveProjectDetailInfoQ;
                if (sendParams.id) {
                    url = api.updateProjectDetailInfoQ;
                }

                this.axios.post(url, sendParams).then((res) => {
                    if (res.data.code === 200) {
                        this.$router.back();
                    }
                });
                console.log(sendParams);
            },
            concatData() {
                let project = this.projectList.find(item => {
                    if (item.estateProjectId === this.ruleForm1.projectId) {
                        return item
                    }
                });
                this.totalData = {
                    investId: this.investId,
                    firstStep: {
                        mongoProjectId: project.estateProjectId,
                        projectName: project.projectName,
                        companyId: this.projectCheck.companyId,
                        companyName: this.projectCheck.companyName,
                        cityId: this.projectCheck.cityId,
                        cityName: this.projectCheck.city,
                        accountCompanyId: this.choseCompanySelected.id,
                        accountCompanyName: this.ruleForm1.companyName,
                        accountName: this.ruleForm1.openingBank,
                        openingBank: this.ruleForm1.bankName,

                        bankAccount: this.ruleForm1.bankAccount,
                        bankNumber: this.ruleForm1.bankNumber,
                        bankAreaCode: this.ruleForm1.bankAreaCode,
                        openingBankProvince: this.ruleForm1.openingBankProvince,
                        openingBankCity: this.ruleForm1.openingBankCity,

                        applyBeginTime: utils.getTimeString(this.ruleForm1.date1),
                        applyEndTime: utils.getTimeString(this.ruleForm1.date2),
                        investBeginTime: utils.getTimeString(this.ruleForm1.date3),
                        investEndTime: utils.getTimeString(this.ruleForm1.date4),

                        estimateCycle: this.ruleForm1.estimateCycle,
                        gainsType: this.ruleForm1.gainsType,
                        investPlan: this.ruleForm1.investPlan,
                        gainsExplain: this.ruleForm1.gainsExplain,
                        applyRule: this.ruleForm1.applyRule,
                    },
                    secondStep: {
                        ruleForm2: this.$refs.secondStep.ruleForm2,
                        bindStandardInfo: this.$refs.secondStep.bindStandardInfo
                    },
                    thirdStep: {
                        ruleForm3: this.$refs.thirdStep.ruleForm3
                    },
                    fourthStep: {
                        projectFixedPersonList: this.$refs.fourthStep.projectFixedPersonList,
                        type: 'new'
                    },
                };
            },
            getDetails(id) {
                this.axios.get(`${api.getProjectProDetails}/${id}`).then(res => {
                    if (res.data.code === 200) {
                        this.renderData(res.data.data)
                    }
                })
            },
            renderData(data) {
                this.ruleForm1.projectId = data.projectInfo.mongoProjectId;
                this.projectCheck.companyName = data.projectInfo.companyName;
                this.projectCheck.city = data.projectInfo.cityName;
                this.projectCheck.cityId = data.projectInfo.cityId;
                this.projectCheck.businessModeCode = data.projectInfo.businessMode;
                this.choseCompanySelected.id = data.projectInfo.accountCompanyId;
                this.ruleForm1.companyName = data.projectInfo.accountCompanyName;
                this.ruleForm1.openingBank = data.projectInfo.accountName;
                this.ruleForm1.bankName = data.projectInfo.openingBank;
                this.ruleForm1.bankAccount = data.projectInfo.bankAccount;
                this.ruleForm1.bankNumber = data.projectInfo.bankNumber;

                this.ruleForm1.bankAreaCode = data.projectInfo.bankAreaCode;
                this.ruleForm1.openingBankProvince = data.projectInfo.openingBankProvince;
                this.ruleForm1.openingBankCity = data.projectInfo.openingBankCity;

                this.ruleForm1.date1 = new Date(data.projectInfo.applyBeginTime) * 1;
                this.ruleForm1.date2 = new Date(data.projectInfo.applyEndTime) * 1;
                this.ruleForm1.date3 = new Date(data.projectInfo.investBeginTime) * 1;
                this.ruleForm1.date4 = new Date(data.projectInfo.investEndTime) * 1;
                this.ruleForm1.estimateCycle = data.projectInfo.estimateCycle;
                this.ruleForm1.gainsType = data.projectInfo.gainsType + '';
                this.ruleForm1.investPlan = data.projectInfo.investPlan;
                this.ruleForm1.gainsExplain = data.projectInfo.gainsExplain;
                this.ruleForm1.applyRule = data.projectInfo.applyRule;


                return Promise.all([
                    this.axios.post(api.followUpControlDetail, {id: data.projectStandard[0].standardId}),
                    this.axios.get(api.DISTRIBUTTIONVIEW + data.projectStandard[1].standardId),
                    this.axios.get(api.INVESTSECTIONS + "/" + data.projectStandard[2].standardId),
                ]).then(res => {
                    this.renderData2 = {
                        totalAmount: data.projectInfo.investTotalMoney,
                        profitPercent: data.projectInfo.projectedProfitMargin,
                        bindStandardInfo: [res[0].data.data, res[1].data.data, res[2].data.data]
                    };
                    this.renderData3 = {
                        count: data.projectRaise.investNum,
                        maxCount: data.projectRaise.maxInvestNum,
                        minCount: data.projectRaise.minInvestNum,
                    };
                    this.renderData4 = data.distributionList;
                })
            },

        },
        created() {
            this.pageType = this.$route.query.type;

            if (this.pageType === 'edit') {
                this.investId = this.$route.query.id;
                this.getDetails(this.$route.query.id);
            }
            this.getAllPassProject()
        }
    }
</script>

<style scoped lang="stylus">
    .operateFollowPro {
        .flex-content {
            display: flex;
            width: 1050px;
            & > div {
                flex: 1;
                padding-right: 50px;
            }
        }

    }
</style>
